// 考试模块所有请求

import request from '@/utils/request'

// 请求获取科目树数据
export const getTreeList = () => {
  return request({
    url: '/subject/tree'
  })
}

// 请求获取试题列表
export const getQuestionList = (params) => {
  return request({
    url: '/exam/question',
    params
  })
}
// 获取单个试题信息
export const editQuestionShow = (data) => {
  return request({
    method: 'POST',
    url: `/exam/question/show`,
    data
  })
}
// 新增试题信息
export const editQuestionCheck = (data) => {
  return request({
    method: 'POST',
    url: '/exam/question/check',
    data
  })
}

export const deleteQuestion = (id) => {
  return request({
    method: 'DELETE',
    url: `/exam/question/${id}`
  })
}

export const getEditdetail = (id) => {
  return request({
    url: `/exam/question/${id}`
  })
}

export const addQuestion = (data) => {
  return request({
    method: 'post',
    url: `/exam/question`,
    data
  })
}
export const editQuestion = (data) => {
  return request({
    method: 'PUT',
    url: `/exam/question/${data.id}`,
    data
  })
}

